#if !defined(_PHOTOSNAPPER_H_)
#define _PHOTOSNAPPER_H_

typedef struct {
    int PhotoResolution;
    int m_iFrameRate;
    int m_iZoom;
    int m_iBrightness;
    int m_iContrast;
    int m_iSharpness;
    int m_iWhiteBalance;
    int m_iColorMode;
    int m_iSceneMode;
    int m_iDirection;
    int m_iFlash;
    int m_iISO;
    int m_iExposureCompensation;
    int m_iContinuousSnaps;
} PhotoSnapperFormat;

class PhotoSnapper
{
private:
    unsigned long       m_ulSnapFrameWidth;
    unsigned long       m_ulSnapFrameHeight;

    unsigned int        m_uSnapCount;
    unsigned int        m_uCurrentSnapIdx;

    BYTE               *m_pSnapFramedBuf;
    unsigned long       m_ulSnapBufFrameLen;

    PhotoSnapperFormat  m_SnapperFormat;

    FrameCapture       *m_pCapture;

    FrameDisplay       *m_pShower;

    RGB2YCbCrConverter *m_pConverter;

    HANDLE              m_hSnapEvent;

    HANDLE              m_hSnapLock;

private:
    void  InitPhotoSnapperFormat();

    void  ResolutionToSize(int Resolution,
                           unsigned long *pWidth,
                           unsigned long *pHeight);

    ECode SetSnapSize();

    BOOL  SetSnapBuffer();

    void  GetSnapDest(YCbCrBufferInfo *pYCbCrInfo);


public:
    BOOL  Initialize(FrameCapture *pCap,
                      FrameDisplay *pShower,
                      RGB2YCbCrConverter *pConverter);

    void  Destroy();

    ECode GetPhotoSnapperFormat(unsigned int nID,
                                  int *pwParam,
                                  int *plParam);

    ECode SetPhotoSnapperFormat(unsigned int nID,
                                  int wParam,
                                  int lParam);

    void  DoSnap(void *pFrameBuffer);

    ECode SnapPhotos(Camera_Photo *pPhoto);

};

#endif //_PHOTOSNAPPER_H_
